<template>
	<view style="position: relative">
		<view class="note">
			<image style="width: 100%;height: 221px;z-index: 2;" src="/static/font/zdbj.png" mode=""></image>
			<view class="notes">

			</view>
		</view>
		<!-- <view class="notes">

		</view> -->
		<u-navbar title="项目详情" :fixed="false" :bgColor="bgColor" :titleStyle="titleStyle" left-icon-color="#fff"
			:placeholder="true" @rightClick="rightClick" :autoBack="true">
		</u-navbar>
		<view class="contant" style="position: relative;padding: 13px 13px 23px;">
			<view style=" border-radius: 10px; display: flex;justify-content: space-between;">
				<view class="" style="display: flex;align-items: center;width: 70%;">
					<view style="width: 50px; height: 50px">
						<image style="width: 50px; height: 50px; border-radius: 10px; display: block"
							:src="imgurl + project_info.logo_image" mode=""></image>
					</view>
					<view style="margin-left: 10px; width: 80%">
						<view style="font-size: 16px;color: #FFFFFF;">{{ project_info.title }}</view>
						<view class="opd" style="margin-top: 5px; font-size: 12px; color: #E7E7E7; width: 100%">
							{{ project_info.introduction }}
						</view>
					</view>
				</view>
				<view @click="btn(3)" class="flex" style="justify-content: center;">
					<text style="padding: 5px 14px;font-size: 13px;font-weight: 500;color: #4C79FF;background-color: #FFFFFF;border-radius: 20px;
							">结算明细</text>
				</view>
			</view>
		</view>
		<view class="contant" style="background-color: #FFFFFF;border-radius: 20px 20px 0 0;">
			<!-- <u-sticky > -->
			<view class="flex tabsh" style="justify-content: space-around;">
				<view @click="btn(it.id)" :class="current == it.id ? 'ipo' : 'upo'"
					style=" color: #747777; font-size: 16px;display: flex;flex-direction: column;align-items: center;text-align: center;width: 50%;"
					v-for="(it, i) in arr" :key="i">
					<view class="">
						{{ it.name }}
					</view>
					<view v-if="current == it.id" class=""
						style="background: #364EF6;width: 22px;height: 4px;margin-top: 13px;">

					</view>
				</view>
			</view>
			<!-- </u-sticky> -->
			<view class="" style="padding: 15px 15px 50px;">

				<!-- 项目详情 -->
				<view v-if="current == 1">
					<!-- 项目通知 -->
					<view style="background-color: #fff; padding: 15px; border-radius: 10px">
						<view class="flex" style="margin-bottom: 15px">
							<image style="width: 16px; margin-right: 10px" src="/static/font/16.png" mode="widthFix">
							</image>
							<view style="font-size: 16px">项目通知</view>
						</view>
						<view class="" v-if="notice_arr != ''"
							style="box-shadow: -1px 0 5px 0px rgba(0, 0, 0, 0.10);padding: 13px;border-radius: 8px;">
							<view @click="ninfo(it)" class="flex news" v-for="(it, i) in notice_arr">
								<view style="
										width: 30px;
										line-height: 18px;
										background: #FF5500;
										border-radius: 8px;
										font-size: 10px;
										color: #fff;
										text-align: center;
										margin-right: 15px;
									">
									最新
								</view>
								<view
									style="font-size: 14px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; width: 80%">
									{{ it.title }}
								</view>
							</view>
						</view>
						<view class="" v-else>
							<view class="flex news">
								<view
									style="font-size: 14px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; width: 80%">
									暂无公告
								</view>
							</view>
						</view>
					</view>
					<!-- 开码流程 -->
					<view v-show="project_info.codeflow"
						style="background-color: #fff; padding: 15px; border-radius: 10px; margin-top: 15px">
						<view class="flex" style="margin-bottom: 15px">
							<image style="width: 16px; margin-right: 10px" src="/static/font/19.png" mode="widthFix">
							</image>
							<view style="font-size: 16px">开码流程</view>
						</view>
						<view class="flex"
							style="background-color: #fff; padding: 15px; border-radius: 10px; box-shadow: -1px 0 5px 0px rgba(0, 0, 0, 0.10);">
							<u-parse :selectable="true" :content="project_info.codeflow"></u-parse>
						</view>
					</view>
					<!-- 项目说明 -->
					<view style="background-color: #fff; padding: 15px; border-radius: 10px; margin-top: 15px;">
						<view class="flex" style="margin-bottom: 15px">
							<image style="width: 16px; margin-right: 10px" src="/static/img/14.png" mode="widthFix">
							</image>
							<view style="font-size: 16px">项目说明</view>
						</view>
						<view class="flex"
							style="background-color: #fff; padding: 15px; border-radius: 10px; box-shadow: -1px 0 5px 0px rgba(0, 0, 0, 0.10);">
							<u-parse :selectable="true" :content="project_info.content"></u-parse>
						</view>
					</view>

					<!-- 项目流程 -->
					<view v-if="project_info.tutorial != null"
						style="background-color: #fff; padding: 15px; border-radius: 10px; margin-top: 15px">
						<view class="flex" style="margin-bottom: 15px">
							<image style="width: 16px; margin-right: 10px" src="/static/img/16.png" mode="widthFix">
							</image>
							<view style="font-size: 16px">项目流程</view>
						</view>
						<view class="flex"
							style="background-color: #fff; padding: 15px; border-radius: 10px; box-shadow: -1px 0 5px 0px rgba(0, 0, 0, 0.10);">
							<u-parse :selectable="true" :content="project_info.tutorial"></u-parse>
						</view>
					</view>
				</view>
				<!-- 推广码 -->
				<view v-if="current == 2" style="padding: 15px; background-color: #fff; border-radius: 10px; margin-bottom: 15px;
							box-shadow: -1px 0 5px 0px rgba(0,0,0,0.1);" v-for="(it, i) in promotion_list" :key="i">
					<view class="flex" style="justify-content: space-between; width: 100%">
						<view style="width: 70%">
							<view style="font-size: 13px; color: #1d1f20; font-weight: 400">
								业务员：{{ it.signname }}
								{{ it.signphone }}
							</view>
							<view v-if="it.promotioncode != null"
								style="margin-top: 5px; font-size: 10px; color: #8b8d8d">
								绑定日期:{{ it.bindtime }}
							</view>

						</view>
						<view v-if="it.status == 2" style="text-align: center" @click="chakan(it)">
							<image style="width: 40px; height: 40px" src="/static/img/10.png" mode=""></image>
							<view style="margin-top: 10px; color: #898b8b; font-size: 12px">查看推广码</view>
						</view>
						<view v-if="it.status == 3" class="flex" style="text-align: center;">
							<view class="flex" @click="Nav(4, it)" style="font-size: 12px;">
								<text>修改资料</text>
								<u-icon name="arrow-right"></u-icon>
							</view>
						</view>
					</view>
					<view class="" style="padding-bottom: 16px;border-bottom: 1px solid #ececec;">
						<view v-if="it.status == 2 || it.status == 4" class="flex" style="padding: 10px 0px 0;">
							<view @click="Nav(1, it)"
								style="font-size: 12px; color: #52C18E;background-color: #DEF9E8;padding: 6px 6px;border-radius: 5px;">
								官方明细</view>
							<view v-if="it.promotioncode != null && it.promotioncode.bind_link != ''" class="">
								<view v-if="it.status == 2" @click="Nav(2, it)" style="font-size: 12px; color: #657CF0;background-color: #E8EEFF;
							padding: 6px;border-radius: 5px;margin-left: 10px;">实时查询
								</view>
							</view>
							<view @click="Nav(3, it)" style="font-size: 12px; color: #E68D8A;background-color: #FFEAE7;
							padding: 6px;border-radius: 5px;margin-left: 10px;">结算明细</view>
							<view @click="Nav(4, it)" style="font-size: 12px; color: #F0AF65;background-color: #FFEEE0;
							padding: 6px;border-radius: 5px;margin-left: 10px;">报备资料</view>
						</view>
						<!-- <view v-if="it.status == 3" class="flex" style="padding: 15px 0px 0; justify-content: center;">
						<view @click="Nav(4, it)" style="font-size: 12px; color: #F0AF65;background-color: #FFEEE0;
							padding: 6px;border-radius: 5px;margin-left: 10px;">修改资料</view>
					</view> -->
						<view v-if="it.status == 1" class="flex" style="padding: 15px 0px 0;">
							<view @click="Nav(4, it)" style="font-size: 12px; color: #F0AF65;background-color: #FFEEE0;
							padding: 6px;border-radius: 5px;">报备资料</view>
						</view>
					</view>
					<view class="flex" style="padding-top: 12px;justify-content: space-between;">
						<view :class="it.status == 3 || it.status == 4 ? 'bfb' : ''" style="">
							<view class="flex">
								<!-- <image style="width: 16px" src="/static/img/12.png" mode="widthFix"></image> -->
								<view v-if="it.status == 2"
									style="font-size: 12px;font-weight: 500;color: #33BC1B;line-height: 10px;">
									{{ it.status_text }}
								</view>
								<view v-if="it.status == 3"
									style="font-size: 12px;font-weight: 500;color: #FF0000;line-height: 10px;">
									{{ it.status_text }}
								</view>
								<view v-if="it.status == 4"
									style="font-size: 12px;font-weight: 500;color: #FF0000;line-height: 10px;">
									{{ it.status_text }}
								</view>
								<view v-if="it.status == 1"
									style="font-size: 12px;font-weight: 400;color: #FF5500;line-height: 10px;">
									{{ it.status_text }}
								</view>
							</view>
							<text v-if="it.status == 3" style="
									font-size: 12px;
									font-weight: 400;
									color: #ff3331;
									width: 100%;
									word-break: break-all;
									padding-top: 5px;
								">
								原因：{{ it.audit_result }}
							</text>
							<text v-if="it.status == 4" style="
									font-size: 12px;
									font-weight: 400;
									color: #ff3331;
									width: 100%;
									word-break: break-all;
									padding-top: 5px;
								">
								原因：{{ it.pause_result }}
							</text>
						</view>
						<view class="" v-if="it.status == 2">
							<view class="flex" style="" v-if="project_info.is_handcheck == 1">
								<view class="flex">
									<view style="font-size: 11px; color: #999999;">作业需交单：</view>
									<view @click="lj_jdan(it)" style="font-size: 11px; color: #ff3331;background-color: #4C79FF;padding: 2px 6px;border-radius: 60px;
										font-weight: 500;
										color: #FFFFFF;
										line-height: 18px;">
										立即交单</view>
								</view>
								<view @click="jdan(it)" class="jdjl" style="">交单记录</view>
							</view>
						</view>
					</view>

				</view>
			</view>
		</view>
		<view class="flex"
			style="position: fixed; bottom: 0; width: 100%; z-index: 100;background-color: #fff;height: 62px;">
			<view class="flex" style="justify-content: space-between;align-items: center;width: 92%;margin: 0 auto;">
				<view @click="Nav(6)" style="text-align: center; padding: 7px 0 7px; background-color: #fff; font-size: 14px; width: 48%;border: 1px solid #2447FF;
					font-size: 14px;
					font-weight: 500;
					color: #2447FF;border-radius: 8px;">
					开码记录
				</view>
				<view @click="Nav(5)" style="
						text-align: center;
						padding: 7px 0 7px;
						background-color: #2447FF;
						font-size: 14px;
						color: #fff;
						width: 48%;border-radius: 8px;
					">
					新增推广码
				</view>
			</view>
		</view>
		<!-- 交单弹窗 -->
		<u-popup :round="10" :show="show" mode="center" @close="close" :closeable="true">
			<view style="padding: 15px" class="jd-con">
				<view style="text-align: center">提交交单资料</view>
				<view class="" v-if="project_info.hand_type == 1">
					<view class="flex" style="margin-top: 30px">
						<!-- <view style="font-size: 16px; width: 80px">文本交单</view> -->
						<!-- <view style="font-size: 12px; color: #797b7b">注意一个手机号只能提交一个项目</view> -->
					</view>
					<view class="flex" style="margin-top: 15px" v-for="(v, i) in show_list" :key="i">
						<view style="font-size: 16px; width: 80px">{{ v.value }}</view>
						<view @click="fouse(i)" style="padding-left: 10px">
							<u--input @focus="fouse(i)" @input="input" placeholder="请输入内容" v-model="v.name"
								border="surround" clearable></u--input>
						</view>
					</view>
				</view>
				<view class="" v-if="project_info.hand_type == 2">
					<view class="">
						<view class="flex" style="margin-top: 30px">
							<!-- <view style="font-size: 16px">文本交单：</view> -->
							<!-- <view style="font-size: 12px;color: #797B7B;">
								注意一个手机号只能提交一个项目
							</view> -->
						</view>
						<view class="flex" style="margin-top: 15px" v-for="(v, i) in show_list" :key="i">
							<view style="font-size: 16px; width: 80px">{{ v.value }}</view>
							<view @click="fouse(i)" style="padding-left: 5px">
								<u--input @focus="fouse(i)" @input="input"  placeholder="请输入内容" v-model="v.name"
									border="surround" clearable></u--input>
							</view>
						</view>
					</view>
					<view class="flex" style="margin-top: 30px; flex-direction: column; align-items: flex-start">
						<view class="flex">
							<view style="font-size: 16px">图片交单：</view>
							<!-- <view style="font-size: 12px;color: #797B7B;">
								请按示列图展示的截图提交
							</view> -->
						</view>
					</view>
					<view class="flex" v-for="(it, index) in show_img" :key="index">
						<view @click="chakan_slin(it)" class=""
							style="font-size: 12px; font-weight: 400; color: #ff3331; padding-top: 10px; padding-bottom: 10px;position: relative;">
							<image style="width: 80px;
										height: 80px;border-radius: 10px;" :src="imgurl + it.img" mode=""></image>
							<view class="" style="position: absolute;top: 35px;writing-mode: vertical-lr;left: 30px;color: #666666;">
								<text>示例图</text>
							</view>
							<!-- {{ it.filed }}(点击查看示列图) -->
						</view>
						<view class="" style="margin-left: 12px;" v-if="index == 0">
							<u-upload :capture="capture" :fileList="fileList1" @afterRead="afterRead"
								@delete="deletePic" name="1" multiple :maxCount="1">
								<view class="flex" style="
										width: 80px;
										height: 80px;
										border-radius: 10px;
										justify-content: center;
										background-color: #f7f9fa;
									">
									<u-icon name="plus" size="50"></u-icon>
								</view>
							</u-upload>
						</view>
						<view class="" v-if="index == 1">
							<u-upload :capture="capture" :fileList="fileList2" @afterRead="afterRead"
								@delete="deletePic" name="2" multiple :maxCount="1">
								<view class="flex" style="
										width: 80px;
										height: 80px;
										border-radius: 10px;
										justify-content: center;
										background-color: #f7f9fa;
									">
									<u-icon name="plus" size="50"></u-icon>
								</view>
							</u-upload>
						</view>
						<view class="" v-if="index == 2">
							<u-upload :capture="capture" :fileList="fileList3" @afterRead="afterRead"
								@delete="deletePic" name="3" multiple :maxCount="1">
								<view class="flex" style="
										width: 80px;
										height: 80px;
										border-radius: 10px;
										justify-content: center;
										background-color: #f7f9fa;
									">
									<u-icon name="plus" size="50"></u-icon>
								</view>
							</u-upload>
						</view>
						<view class="" v-if="index == 3">
							<u-upload :capture="capture" :fileList="fileList4" @afterRead="afterRead"
								@delete="deletePic" name="4" multiple :maxCount="1">
								<view class="flex" style="
										width: 80px;
										height: 80px;
										border-radius: 10px;
										justify-content: center;
										background-color: #f7f9fa;
									">
									<u-icon name="plus" size="50"></u-icon>
								</view>
							</u-upload>
						</view>
						<view class="" v-if="index == 4">
							<u-upload :capture="capture" :fileList="fileList5" @afterRead="afterRead"
								@delete="deletePic" name="5" multiple :maxCount="1">
								<view class="flex" style="
										width: 80px;
										height: 80px;
										border-radius: 10px;
										justify-content: center;
										background-color: #f7f9fa;
									">
									<u-icon name="plus" size="50"></u-icon>
								</view>
							</u-upload>
						</view>
						<view class="" v-if="index == 5">
							<u-upload :capture="capture" :fileList="fileList6" @afterRead="afterRead"
								@delete="deletePic" name="6" multiple :maxCount="1">
								<view class="flex" style="
										width: 80px;
										height: 80px;
										border-radius: 10px;
										justify-content: center;
										background-color: #f7f9fa;
									">
									<u-icon name="plus" size="50"></u-icon>
								</view>
							</u-upload>
						</view>
					</view>
				</view>
				<view style="padding: 0px 30px; margin-top: 30px">
					<view @click="confirms" class="flex" style="
							width: 255px;
							height: 40px;
							background: #2447FF;
							border-radius: 20px;
							justify-content: center;
							color: #fff;
							font-size: 14px;
						">
						确认提交
					</view>
				</view>
			</view>
		</u-popup>
		<!-- 确认弹窗 -->
		<u-popup :round="10" :show="shows" mode="center">
			<view  style="padding: 0px 45px 15px;min-width: 165px;" v-if="ttq">
				<!-- <image style="width: 217px; margin: -90px auto 0px; text-align: center; display: block"
					src="/static/img/11.png" mode="widthFix"></image> -->
				<view style="text-align: center; margin-top: 30px">{{ msg }}</view>

				<view class="flex" style="margin-top: 30px;text-align: center;justify-content: center;">
					<view class="flex" @click="shows = false" style="
							width: 159px;
							height: 40px;
							background: #2447FF;
							border-radius: 20px;
							justify-content: center;
							color: #fff;
							font-size: 14px;
						">
						返回
					</view>
				</view>
			</view>
			<view class="ttq-com" style="padding: 0px 45px 15px;position: relative;min-width: 165px;width: 165px;" v-if="!ttq">
				<!-- <image style="width: 217px; margin: -90px auto 0px; text-align: center; display: block"
					src="/static/font/23.png" mode="widthFix"></image> -->
				<view style="text-align: center; margin-top: 191px">{{ msg }}</view>
				<!-- <view style="text-align: center; margin-top: 191px">交单成功</view> -->
			
				<view style="margin-top: 35px">
					<view class="flex" @click="shows = false" style="
							width: 159px;
							height: 40px;
							background: #2447FF;
							border-radius: 20px;
							justify-content: center;
							color: #fff;
							font-size: 14px;
						">
						返回
					</view>
				</view>
			</view>
		</u-popup>

		<!-- 查看推广码弹窗 -->
		<u-popup :round="10" :show="ma_show" mode="center" @close="ma_show = false">
			<view class="ma_con" style="padding: 15px; min-width: 300px;position: relative;">
				<view class="flex" style="margin-top: 30px;text-align: center;justify-content: center;">
					<view style="color: #1d1f20;
					font-size: 23px;
					font-weight: 400;
					background: linear-gradient(180deg, #CC4603 0%, #FF5500 99%);-webkit-background-clip: text;
				-webkit-text-fill-color: transparent;">作业码</view>
					<!-- <view style="font-size: 14px; font-weight: 400; color: #1d1f20">(长按图片保存)</view> -->
				</view>
				<view style="margin-top: 10px;font-size: 14px;font-weight: 400;background: linear-gradient(180deg, #C84504 0%, #FF5500 100%);
				-webkit-background-clip: text;
				-webkit-text-fill-color: transparent;text-align: center;">引导用户通过扫描此码来完成相应的任务</view>
				<view class="flex" style="justify-content: center;flex-direction: column;"
					v-if="project_info.is_scancode_work == 1">
					<view style="margin-top: 72px;width: 118px;height: 118px;">
						<image style="width: 118px;height: 118px;" :src="imgurl + chakn_info.qrcode_show" mode="">
						</image>
					</view>
					<view style="margin-top: 10px; font-size: 14px; text-align: center">长按图片保存</view>
					<view class="flex" style="margin-top: 10px; justify-content: center">
						<view @click="copy(chakn_info.link)" class="flex" style="
								width: 159px;
								height: 40px;
								background: #2447FF;
								border-radius: 20px;
								justify-content: center;
								color: #fff;
								font-size: 14px;
							">
							复制推广链接
						</view>
					</view>
				</view>
				<view v-if="project_info.is_scancode_work == 0" class="flex" style="
						width: 100%;
						height: 314px;
						border-radius: 10px;
						margin-top: 25px;
						justify-content: center;
					">
					<view style="text-align: center; font-size: 15px;font-weight: 600;
							color: #333333;
							line-height: 33px;">
						此项目非扫此码做单
						<br />
						请按照开码流程来<br />
						获取推广码
					</view>
				</view>
				<view  style="position: absolute;bottom: -40px;left: 150px;" @click="ma_show = false">
					<view  class="flex" style="justify-content: center;width: 100%;"> 
						<u-icon size="21" name="close-circle" color="#fff"></u-icon>
					</view>
				</view>
			</view>
		</u-popup>
		<uni-popup ref="alertDialog" type="dialog">
			<uni-popup-dialog cancelText="不再提醒" title="" confirmText="我已知晓" :content="notice" @confirm="dialogConfirm"
				@close="dialogClose"></uni-popup-dialog>
		</uni-popup>
		<u-modal :show="twoshow" :title="title" :content="contents" @confirm="twoconfirm" :closeOnClickOverlay="true"
			@close="twoshow = false" :showCancelButton="true" @cancel="twoconfirm"></u-modal>
	</view>
</template>

<script>
	import config from '@/common/config/index.js';
	export default {
		data() {
			return {
				titleStyle: {
					color: '#fff'
				},
				bgColor: 'rgba(255,255,255,0)',
				contents: '项目已暂停！',
				title: '提示',
				twoshow: false,
				notice_arr: [],
				notice: '',
				ma_show: false,
				show: false,
				shows: false,
				arr: [{
						name: '项目详情',
						id: 1,
					},
					{
						name: '推广码',
						id: 2,
					},
					// {
					// 	name: '结算记录',
					// 	id: 3,
					// },
				],
				current: 1,
				fileList1: [],
				fileList2: [],
				fileList3: [],
				fileList4: [],
				fileList5: [],
				fileList6: [],
				content: `<p>露从今夜白，月是故乡明</p>`,
				project_id: '',
				codeflowpath: '',
				project_info: '',
				projectflowpath: '',
				promotion_list: '',
				imgurl: config.imgurl,
				chakn_info: '',
				show_list: [],
				show_img: [],
				show_msg: [],
				show_index: '',
				img: [],
				sign_id: '',
				msg: '',
				apiUrl: config.prodBase,
				capture: [],
				ttq:null,
			};
		},
		onLoad(e) {
			this.project_id = e.project_id;
			if (e.id) {
				this.current = e.id;
			}
		},
		onShow() {
			if (this.current) {
				this.sign_list();
			}
			this.projectInfo();
			// this.notices()
			this.getProjectNotice();
		},
		methods: {
			focus(e) {
				console.log(55555);
			},
			chakan_slin(it) {
				var urls = [];
				// for (let i = 0; i < this.show_img.length; i++) {
				urls.push(this.imgurl + it.img);
				// }
				uni.previewImage({
					urls: urls,
					loop: true,
				});
			},
			ninfo(it) {
				uni.navigateTo({
					url: '/pages/home/detail?id=' + it.notice_id + '&type=notice',
				});
			},
			fouse(e) {
				this.show_index = e;
			},
			input(e) {
				this.show_msg[this.show_index] = e;
			},
			jdan(e) {
				// return
				uni.navigateTo({
					url: '/pages/project/presentation?id=' + this.project_id + '&name=' + e.signname,
				});
			},
			async lj_jdan(e) {
				this.sign_id = e.id;
				let res = await this.$http.index.showPostProjectInfo({
					project_id: this.project_id,
				});
				if (res.code == 1) {
					this.show_list = res.data.field;
					this.show_list.forEach((res) => {
						res.name = '';
					});
					this.show_img = res.data.img;
					this.show = true;
				} else {
					this.$tips(res.msg);
				}
			},
			twoconfirm() {
				uni.navigateBack({
					delta: 1,
				});
			},
			copy(e) {
				uni.setClipboardData({
					data: e,
					success() {
						uni.showToast({
							icon: 'none',
							title: '复制成功',
						});
					},
				});
			},
			chakan(e) {
				this.chakn_info = e.promotioncode;
				this.ma_show = true;
			},
			async getProjectNotice() {},
			async projectInfo() {
				let res = await this.$http.car.projectInfo({
					project_id: this.project_id,
				});
				if (res.code == 1) {
					// this.twoshow = true
					this.project_info = res.data.project;
					this.notice_arr = res.data.notice;
					this.codeflowpath = res.data.codeflowpath;
					let isphoto = res.data.project.is_take_photo;
					if (isphoto == '0') {
						this.capture = ['album', 'camera'];
					} else {
						this.capture = ['camera'];
					}
					this.projectflowpath = res.data.projectflowpath;
					if (res.data.is_ad == '0') {
						this.notice = res.data.project.ad;
						this.$refs.alertDialog.open();
					}
				} else if (res.code == 201) {
					this.twoshow = true;
				} else {
					uni.showToast({
						icon: 'none',
						title: res.msg,
					});
				}
			},

			async dialogConfirm() {},
			async dialogClose() {
				let res = await this.$http.index.IsseeAd({
					project_id: this.project_id,
				});
			},
			async confirms() {
				// console.log(this.show_list);
				let filds = this.show_msg;
				// if(filds == ''){
				// 	this.$tips('请将表单填写完整！')
				// }
				for (let i = 0; i < this.show_list.length; i++) {
					if (this.show_list[i].name == '') {
						this.$tips('请将表单填写完整！');
						return;
					}
				}
				if (this.img.length != this.show_img.length) {
					this.$tips('请将图片上传完整！！');
					return;
				}
				// return
				let img = this.img;
				let res = await this.$http.index.postProjectInfo({
					project_id: this.project_id,
					signid: this.sign_id,
					fields: filds,
					images: img,
				});
				if (res.code == 1) {
					// uni.showToast({
					// 	icon:'none',
					// 	title:res.msg
					// })
					this.ttq = false
					this.msg = res.msg;
					// this.show_msg = ''
					this.img = [];
					this.fileList1 = [];
					this.fileList2 = [];
					this.fileList3 = [];
					this.fileList4 = [];
					this.fileList5 = [];
					this.fileList6 = [];
					setTimeout(() => {
						this.show = false;
						this.shows = true;
					}, 800);
				} else {
					this.ttq = true
					this.img = [];
					this.fileList1 = [];
					this.fileList2 = [];
					this.fileList3 = [];
					this.fileList4 = [];
					this.fileList5 = [];
					this.fileList6 = [];
					this.msg = res.msg;
					this.show = false;
					this.shows = true;
				}
			},
			//判断有无公告
			notices() {},
			tiaozhuan(url) {
				// #ifdef APP
				plus.runtime.openURL(url);
				// #endif
				// #ifdef H5
				window.location.href = url;
				// #endif
			},
			Nav(i, it) {
				switch (i) {
					case 1:
						uni.navigateTo({
							url: 'official?project_id=' + this.project_id + '&name=' + it.signname +
								'&applyphone=' + it.signphone,
						});
						break;
					case 2:
						this.tiaozhuan(it.promotioncode.bind_link);
						break;
					case 3:
						uni.navigateTo({
							url: 'settlement?type=1&name=' +
								it.signname +
								'&applyphone=' +
								it.signphone +
								'&project_id=' +
								this.project_id,
						});
						break;
					case 4:
						uni.navigateTo({
							url: 'reporting?type=1&project_id=' + this.project_id + '&sign_id=' + it.id,
						});
						break;
					case 5:
						uni.navigateTo({
							url: 'reporting?type=2&project_id=' + this.project_id,
						});
						break;
					case 6:
						this.current = 2;
						this.sign_list();
						// uni.navigateTo({
						// 	url: '/pages/project/detail?id=2&project_id=' + this.project_id
						// })
						break;
				}
			},

			close() {
				this.show = false;
			},
			btn(id) {
				if (id == 3) {
					uni.navigateTo({
						url: '/pages/project/settlement?type=2&project_id=' + this.project_id,
					});
				} else if (id == 1) {
					this.current = id;
				} else {
					this.current = id;
					this.sign_list();
				}
			},
			async sign_list() {
				let res = await this.$http.index.signUpList({
					project_id: this.project_id,
				});
				if (res.code == 1) {
					this.promotion_list = res.data;
				}
			},
			// 删除图片
			deletePic(event) {
				this[`fileList${event.name}`].splice(event.index, 1);
				this.img.splice(event.index, 1);
			},
			// 新增图片
			async afterRead(event) {
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file);
				let fileListLen = this[`fileList${event.name}`].length;
				lists.map((item) => {
					this[`fileList${event.name}`].push({
						...item,
						status: 'uploading',
						message: '上传中',
					});
				});
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url);
					let item = this[`fileList${event.name}`][fileListLen];
					this[`fileList${event.name}`].splice(
						fileListLen,
						1,
						Object.assign(item, {
							status: 'success',
							message: '',
							url: result,
						})
					);
					fileListLen++;
				}
			},
			uploadFilePromise(url) {
				return new Promise((resolve, reject) => {
					console.log(resolve);
					let a = uni.uploadFile({
						url: this.apiUrl + 'common/upload', // 仅为示例，非真实的接口地址
						filePath: url,
						name: 'file',
						header: {
							token: uni.getStorageSync('token'),
						},
						formData: {},
						success: (res) => {
							let that = this;
							let data = JSON.parse(res.data);
							that.img.push(data.data.fullurl);
							setTimeout(() => {
								resolve(res.data.data);
							}, 1000);
						},
					});
				});
			},
		},
	};
</script>
<style>
	page {
		background-color: #fff;
	}
</style>

<style scoped lang="less">
	.note {
		position: fixed;
		height: 371px;
		// background: linear-gradient(180deg, #4574FF, #F9F9F9);
		width: 100%;
		// background-image: url('@/static/font/zdbj.png');
		background-size: 100% 100%;
	}

	.notes {
		position: fixed;
		top: 195px;
		height: 130px;
		background: linear-gradient(180deg, #4574FF, #fff);
		width: 100%;
	}

	/deep/ .uni-dialog-button-text {
		color: #ff3331;
	}

	/deep/ .uni-dialog-title {
		display: none !important;
	}

	/deep/ .uni-button-color {
		color: #1d1f20;
	}

	/deep/ .u-sticky {
		z-index: 90 !important;
	}

	.news {
		margin-bottom: 15px;

		&:last-child {
			margin-bottom: 0px;
		}
	}

	.ipo {
		color: #000000 !important;
		font-weight: bold;
		background-color: #fff;
		padding: 15px 0;
		border-radius: 20px 20px;
	}

	.upo {
		width: 100%;
		padding: 15px 0;
	}

	.flex {
		display: flex;
		align-items: center;
	}

	.contant {
		width: 93%;
		margin: 0 auto;
		// padding: 13px 13px 50px;
		position: relative;
	}

	.opd {
		-webkit-line-clamp: 2; // 设置两行文字溢出
		display: -webkit-box;
		/** 对象作为伸缩盒子模型显示 **/
		-webkit-box-orient: vertical;
		/** 设置或检索伸缩盒对象的子元素的排列方式 **/
		overflow: hidden;
		/** 隐藏超出的内容 **/
	}

	/deep/.uni-dialog-content-text {
		text-align: center;
	}

	.tabsh {
		background: linear-gradient(180deg, #D6E2FF, #fff);
		border-radius: 20px 20px 0 0;
	}

	/deep/.u-sticky__content {
		border-radius: 20px 20px 0 0;
	}

	.bfb {
		align-items: baseline;
		width: 100%;
		flex-direction: column;
		align-items: flex-start;
	}

	.jdjl {
		font-size: 11px;
		color: #4C79FF;
		background-color: #fff;
		padding: 2px 6px;
		border-radius: 60px;
		font-weight: 500;
		border: 1px solid #4C79FF;
		margin-left: 12px;
		line-height: 18px;
	}

	.ma_con {
		background-image: url('@/static/font/20.png');
		height: 377px;
		background-size: 100% 100%;
	}
	.jd-con{
		background-image: url('@/static/font/22.png');
		height: 392px;
		background-size: 100% 100%;
	}
	.ttq-com{
		background-image: url('@/static/font/23.png');
		height: 314px;
		width: 100%;
		background-size: 100% 100%;
	}
</style>